//
//  UIVisualEffectView+MistyGlass.m
//  hymn
//
//  Created by glory on 15/3/18.
//  Copyright (c) 2015年 ios. All rights reserved.
//

#import "UIVisualEffectView+MistyGlass.h"

@implementation UIVisualEffectView (MistyGlass)

static UIVisualEffectView *_visi;

+(void)showInView:(UIView *)view withGlassFrame:(CGRect)frame{
    UIBlurEffect *blur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
    _visi = [[UIVisualEffectView alloc] initWithEffect:blur];
    [_visi removeFromSuperview];
    [view addSubview:_visi];
    [_visi mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(view.mas_left);
        make.bottom.equalTo(view.mas_bottom);
        make.width.equalTo(@(frame.size.width));
        make.height.equalTo(@(frame.size.height));
    }];
}
+(void)removEffecteFromSuperView{
    [_visi removeFromSuperview];
}
@end
